/**
 * Created by Administrator on 2015/11/27.
 */
$(function () {
    $("#but_files").click(function () {
        var project = [];
        $("input#pro_id").each(function () {
            if ($(this).attr("checked")) {
                project.push($(this).val())
            }
        });
        var pro_str = project.join(',');
        var users = [];
        $("input#checkbox").each(function () {
            if ($(this).attr("checked")) {
                users.push($(this).val())
            }
        });
        var user_str = users.join(",");
        console.log(users);
        $.get("/gitproject/everyday_everyone_files", {
            from_date: $("#from_date").val(),
            to_date: $("#to_date").val(),
            project: pro_str,
            users: user_str
        }, function (data) {
            console.log();
            $('#container').highcharts({
                title: {
                    x: -20 //center
                },
                subtitle: {
                    text: 'Source: git log',
                    x: -20
                },
                xAxis: {
                    categories: data.date_list
                },
                yAxis: {
                    title: {
                        text: data.update,
                        height: 300
                    },
                    plotLines: [{
                        value: 0,
                        width: 1,

                        color: '#808080'
                    }]
                },
                tooltip: {
                    valueSuffix: ''
                },
                legend: {
                    layout: 'vertical',
                    align: 'right',
                    verticalAlign: 'middle',
                    borderWidth: 0
                },
                series: data.data
            });
        });
    });
});
